home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 September (IDG) / Sep99.iso / Shareware World / Comms & Internet / LinkConverter 1.1.2 / Dialog Director v0.7 / Examples / Expand.as < prev    next >
Encoding:
Text File  |  1998-01-19  |  1.5 KB  |  40 lines  |  [TEXT/ToyS]

  1. -- Expand.rsrc
  2. set dlog128 to {bounds:[50, 50, 360, 162], style:standard window, closeable:true, name:"Copying", contents:[¬
  3.     {class:icon push button, bounds:[10, 80, 30, 100], style:5, contents:1000}, ¬
  4.     {class:gauge, bounds:[50, 30, 250, 42], max value:200}, ¬
  5.     {class:static text, bounds:[120, 120, 300, 136], contents:"folder name"}, ¬
  6.     {class:static text, bounds:[120, 140, 300, 156], contents:"file name"}, ¬
  7.     {class:static text, bounds:[120, 160, 300, 176], contents:"count"}, ¬
  8.     {class:static text, bounds:[120, 180, 300, 196], contents:"time"}, ¬
  9.     {class:static text, bounds:[10, 120, 120, 136], contents:"Folder"}, ¬
  10.     {class:static text, bounds:[10, 140, 120, 156], contents:"File"}, ¬
  11.     {class:static text, bounds:[10, 160, 120, 176], contents:"Items Copied"}, ¬
  12.     {class:static text, bounds:[10, 180, 120, 196], contents:"Time Remaining"}, ¬
  13.     {class:group box, bounds:[40, 90, 300, 92]} ¬
  14.         ] ¬
  15.     }
  16.  
  17. set isExpanded to false
  18. dd install with grayscale
  19. set d1 to dd make dialog dlog128
  20. repeat with n from 0 to 200
  21.     dd set value of item 2 of d1 to n
  22.     dd set contents of items 3 thru 6 of d1 to [n, n, n, n]
  23.     set ui to dd interact with user for max ticks 6
  24.     if ui = 1 then
  25.         dd set contents of item 1 of d1 to 1001
  26.         set R to dd get bounds of d1
  27.         if isExpanded then -- Hide
  28.             set item 4 of R to (item 4 of R) - 98
  29.             set icn to 1000
  30.         else -- Show
  31.             set item 4 of R to (item 4 of R) + 98
  32.             set icn to 1002
  33.         end if
  34.         dd set bounds of d1 to R
  35.         set isExpanded to not isExpanded
  36.         dd set contents of item 1 of d1 to icn
  37.     end if
  38.     if ui = -1 then exit repeat
  39. end repeat
  40. dd uninstall